package com.andy.war.obj.battle;

import java.util.ArrayList;
import java.util.List;

import com.andy.war.util.BuildIdUtil;

public class BattleContext {

	private int bcId;
	private List<Army> attackers;
	private List<Army> defenders;
	
	public BattleContext() {
		bcId = BuildIdUtil.getBcId();
	}
	
	public int getBcId() {
		return bcId;
	}
	public void setBcId(int bcId) {
		this.bcId = bcId;
	}
	public List<Army> getAttackers() {
		if(attackers == null){
			attackers = new ArrayList<Army>();
		}
		return attackers;
	}
	public void setAttackers(List<Army> attackers) {
		this.attackers = attackers;
	}
	public BattleContext addAttacker(Army attacker){
		getAttackers().add(attacker);
		return this;
	}
	public List<Army> getDefenders() {
		if(defenders == null){
			defenders = new ArrayList<Army>();
		}
		return defenders;
	}
	public void setDefenders(List<Army> defenders) {
		this.defenders = defenders;
	}
	public BattleContext addDefender(Army defender){
		getDefenders().add(defender);
		return this;
	}

	/**
	 * 出手
	 */
	public void fight() {
		
	}
	
	
}
